{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "5aabed48",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ID_REF</th>\n",
       "      <th>GSM151259</th>\n",
       "      <th>GSM151260</th>\n",
       "      <th>GSM151261</th>\n",
       "      <th>GSM151262</th>\n",
       "      <th>GSM151263</th>\n",
       "      <th>GSM151264</th>\n",
       "      <th>GSM151265</th>\n",
       "      <th>GSM151266</th>\n",
       "      <th>GSM151267</th>\n",
       "      <th>...</th>\n",
       "      <th>GSM151336</th>\n",
       "      <th>GSM151337</th>\n",
       "      <th>GSM151338</th>\n",
       "      <th>GSM151339</th>\n",
       "      <th>GSM151340</th>\n",
       "      <th>GSM151341</th>\n",
       "      <th>GSM151342</th>\n",
       "      <th>GSM151343</th>\n",
       "      <th>GSM151344</th>\n",
       "      <th>GSM151345</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1007_s_at</td>\n",
       "      <td>8.598882</td>\n",
       "      <td>8.523999</td>\n",
       "      <td>9.151616</td>\n",
       "      <td>8.619172</td>\n",
       "      <td>8.925920</td>\n",
       "      <td>9.616641</td>\n",
       "      <td>9.450158</td>\n",
       "      <td>8.689728</td>\n",
       "      <td>8.925450</td>\n",
       "      <td>...</td>\n",
       "      <td>8.810666</td>\n",
       "      <td>9.876917</td>\n",
       "      <td>9.147250</td>\n",
       "      <td>8.984707</td>\n",
       "      <td>8.769044</td>\n",
       "      <td>7.979955</td>\n",
       "      <td>8.847163</td>\n",
       "      <td>8.667560</td>\n",
       "      <td>9.285763</td>\n",
       "      <td>9.015781</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1053_at</td>\n",
       "      <td>6.848821</td>\n",
       "      <td>6.733007</td>\n",
       "      <td>7.283071</td>\n",
       "      <td>6.460641</td>\n",
       "      <td>6.213657</td>\n",
       "      <td>5.787412</td>\n",
       "      <td>6.121179</td>\n",
       "      <td>6.862273</td>\n",
       "      <td>6.313435</td>\n",
       "      <td>...</td>\n",
       "      <td>5.944039</td>\n",
       "      <td>6.236836</td>\n",
       "      <td>6.280118</td>\n",
       "      <td>6.368237</td>\n",
       "      <td>6.867288</td>\n",
       "      <td>6.934095</td>\n",
       "      <td>5.633570</td>\n",
       "      <td>6.562457</td>\n",
       "      <td>7.143927</td>\n",
       "      <td>6.703256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>117_at</td>\n",
       "      <td>5.141545</td>\n",
       "      <td>6.000812</td>\n",
       "      <td>4.847115</td>\n",
       "      <td>5.887788</td>\n",
       "      <td>5.716745</td>\n",
       "      <td>5.727272</td>\n",
       "      <td>5.307079</td>\n",
       "      <td>4.721051</td>\n",
       "      <td>5.420677</td>\n",
       "      <td>...</td>\n",
       "      <td>4.669397</td>\n",
       "      <td>5.468497</td>\n",
       "      <td>4.565172</td>\n",
       "      <td>4.246593</td>\n",
       "      <td>5.178889</td>\n",
       "      <td>4.718608</td>\n",
       "      <td>5.210969</td>\n",
       "      <td>4.860924</td>\n",
       "      <td>4.545735</td>\n",
       "      <td>5.107950</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>121_at</td>\n",
       "      <td>5.877394</td>\n",
       "      <td>5.956416</td>\n",
       "      <td>6.031219</td>\n",
       "      <td>6.124468</td>\n",
       "      <td>6.323811</td>\n",
       "      <td>6.231946</td>\n",
       "      <td>6.166422</td>\n",
       "      <td>5.987948</td>\n",
       "      <td>6.185425</td>\n",
       "      <td>...</td>\n",
       "      <td>5.631996</td>\n",
       "      <td>6.183228</td>\n",
       "      <td>6.008688</td>\n",
       "      <td>6.200976</td>\n",
       "      <td>6.249420</td>\n",
       "      <td>6.215371</td>\n",
       "      <td>6.558142</td>\n",
       "      <td>5.956507</td>\n",
       "      <td>6.411773</td>\n",
       "      <td>5.660290</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1255_g_at</td>\n",
       "      <td>2.026605</td>\n",
       "      <td>1.880405</td>\n",
       "      <td>1.711745</td>\n",
       "      <td>1.686634</td>\n",
       "      <td>1.828178</td>\n",
       "      <td>1.938201</td>\n",
       "      <td>1.905041</td>\n",
       "      <td>1.829138</td>\n",
       "      <td>1.942084</td>\n",
       "      <td>...</td>\n",
       "      <td>1.686603</td>\n",
       "      <td>1.850454</td>\n",
       "      <td>1.709789</td>\n",
       "      <td>1.946195</td>\n",
       "      <td>1.760028</td>\n",
       "      <td>1.816439</td>\n",
       "      <td>1.810483</td>\n",
       "      <td>1.888790</td>\n",
       "      <td>1.726359</td>\n",
       "      <td>1.731505</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 88 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      ID_REF  GSM151259  GSM151260  GSM151261  GSM151262  GSM151263  \\\n",
       "0  1007_s_at   8.598882   8.523999   9.151616   8.619172   8.925920   \n",
       "1    1053_at   6.848821   6.733007   7.283071   6.460641   6.213657   \n",
       "2     117_at   5.141545   6.000812   4.847115   5.887788   5.716745   \n",
       "3     121_at   5.877394   5.956416   6.031219   6.124468   6.323811   \n",
       "4  1255_g_at   2.026605   1.880405   1.711745   1.686634   1.828178   \n",
       "\n",
       "   GSM151264  GSM151265  GSM151266  GSM151267  ...  GSM151336  GSM151337  \\\n",
       "0   9.616641   9.450158   8.689728   8.925450  ...   8.810666   9.876917   \n",
       "1   5.787412   6.121179   6.862273   6.313435  ...   5.944039   6.236836   \n",
       "2   5.727272   5.307079   4.721051   5.420677  ...   4.669397   5.468497   \n",
       "3   6.231946   6.166422   5.987948   6.185425  ...   5.631996   6.183228   \n",
       "4   1.938201   1.905041   1.829138   1.942084  ...   1.686603   1.850454   \n",
       "\n",
       "   GSM151338  GSM151339  GSM151340  GSM151341  GSM151342  GSM151343  \\\n",
       "0   9.147250   8.984707   8.769044   7.979955   8.847163   8.667560   \n",
       "1   6.280118   6.368237   6.867288   6.934095   5.633570   6.562457   \n",
       "2   4.565172   4.246593   5.178889   4.718608   5.210969   4.860924   \n",
       "3   6.008688   6.200976   6.249420   6.215371   6.558142   5.956507   \n",
       "4   1.709789   1.946195   1.760028   1.816439   1.810483   1.888790   \n",
       "\n",
       "   GSM151344  GSM151345  \n",
       "0   9.285763   9.015781  \n",
       "1   7.143927   6.703256  \n",
       "2   4.545735   5.107950  \n",
       "3   6.411773   5.660290  \n",
       "4   1.726359   1.731505  \n",
       "\n",
       "[5 rows x 88 columns]"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import seaborn as sns\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib notebook\n",
    "\n",
    "df = pd.read_csv('./output.csv')\n",
    "df.head(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "0f731950",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = df.transpose()\n",
    "df = df.rename(columns=df.iloc[0])\n",
    "df.drop(df.index[0], inplace=True)\n",
    "df['cancer'] = 0\n",
    "df.drop(df.columns[-2], axis=1, inplace = True)\n",
    "df.isnull().sum().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "6fb8083e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>1007_s_at</th>\n",
       "      <th>1053_at</th>\n",
       "      <th>117_at</th>\n",
       "      <th>121_at</th>\n",
       "      <th>1255_g_at</th>\n",
       "      <th>1294_at</th>\n",
       "      <th>1316_at</th>\n",
       "      <th>1320_at</th>\n",
       "      <th>1405_i_at</th>\n",
       "      <th>1431_at</th>\n",
       "      <th>...</th>\n",
       "      <th>AFFX-r2-Ec-bioD-5_at</th>\n",
       "      <th>AFFX-r2-P1-cre-3_at</th>\n",
       "      <th>AFFX-r2-P1-cre-5_at</th>\n",
       "      <th>AFFX-ThrX-3_at</th>\n",
       "      <th>AFFX-ThrX-5_at</th>\n",
       "      <th>AFFX-ThrX-M_at</th>\n",
       "      <th>AFFX-TrpnX-3_at</th>\n",
       "      <th>AFFX-TrpnX-5_at</th>\n",
       "      <th>AFFX-TrpnX-M_at</th>\n",
       "      <th>cancer</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>GSM151259</th>\n",
       "      <td>8.598882</td>\n",
       "      <td>6.848821</td>\n",
       "      <td>5.141545</td>\n",
       "      <td>5.877394</td>\n",
       "      <td>2.026605</td>\n",
       "      <td>6.663656</td>\n",
       "      <td>3.334369</td>\n",
       "      <td>3.292818</td>\n",
       "      <td>6.333143</td>\n",
       "      <td>2.777916</td>\n",
       "      <td>...</td>\n",
       "      <td>10.218104</td>\n",
       "      <td>12.182117</td>\n",
       "      <td>12.002252</td>\n",
       "      <td>2.390509</td>\n",
       "      <td>2.225881</td>\n",
       "      <td>1.868638</td>\n",
       "      <td>1.629952</td>\n",
       "      <td>1.948431</td>\n",
       "      <td>1.791261</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>GSM151260</th>\n",
       "      <td>8.523999</td>\n",
       "      <td>6.733007</td>\n",
       "      <td>6.000812</td>\n",
       "      <td>5.956416</td>\n",
       "      <td>1.880405</td>\n",
       "      <td>6.551523</td>\n",
       "      <td>3.330929</td>\n",
       "      <td>3.010386</td>\n",
       "      <td>5.685335</td>\n",
       "      <td>2.83521</td>\n",
       "      <td>...</td>\n",
       "      <td>9.976598</td>\n",
       "      <td>12.083715</td>\n",
       "      <td>11.794364</td>\n",
       "      <td>2.349284</td>\n",
       "      <td>2.214763</td>\n",
       "      <td>1.764588</td>\n",
       "      <td>1.721504</td>\n",
       "      <td>1.858394</td>\n",
       "      <td>2.053418</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>GSM151261</th>\n",
       "      <td>9.151616</td>\n",
       "      <td>7.283071</td>\n",
       "      <td>4.847115</td>\n",
       "      <td>6.031219</td>\n",
       "      <td>1.711745</td>\n",
       "      <td>5.901029</td>\n",
       "      <td>3.218729</td>\n",
       "      <td>2.588752</td>\n",
       "      <td>7.524602</td>\n",
       "      <td>2.330878</td>\n",
       "      <td>...</td>\n",
       "      <td>10.454041</td>\n",
       "      <td>12.334606</td>\n",
       "      <td>12.034793</td>\n",
       "      <td>2.264607</td>\n",
       "      <td>2.138744</td>\n",
       "      <td>1.617288</td>\n",
       "      <td>1.751432</td>\n",
       "      <td>1.831504</td>\n",
       "      <td>2.025358</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>GSM151262</th>\n",
       "      <td>8.619172</td>\n",
       "      <td>6.460641</td>\n",
       "      <td>5.887788</td>\n",
       "      <td>6.124468</td>\n",
       "      <td>1.686634</td>\n",
       "      <td>6.351176</td>\n",
       "      <td>3.397831</td>\n",
       "      <td>3.148233</td>\n",
       "      <td>5.594144</td>\n",
       "      <td>2.884427</td>\n",
       "      <td>...</td>\n",
       "      <td>10.175746</td>\n",
       "      <td>12.317215</td>\n",
       "      <td>11.963655</td>\n",
       "      <td>2.080147</td>\n",
       "      <td>2.276124</td>\n",
       "      <td>1.875681</td>\n",
       "      <td>1.712929</td>\n",
       "      <td>1.925453</td>\n",
       "      <td>1.719681</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>GSM151263</th>\n",
       "      <td>8.92592</td>\n",
       "      <td>6.213657</td>\n",
       "      <td>5.716745</td>\n",
       "      <td>6.323811</td>\n",
       "      <td>1.828178</td>\n",
       "      <td>6.276506</td>\n",
       "      <td>3.612326</td>\n",
       "      <td>3.204559</td>\n",
       "      <td>4.509043</td>\n",
       "      <td>2.546576</td>\n",
       "      <td>...</td>\n",
       "      <td>10.712507</td>\n",
       "      <td>12.522815</td>\n",
       "      <td>12.370773</td>\n",
       "      <td>2.269168</td>\n",
       "      <td>2.166079</td>\n",
       "      <td>1.842607</td>\n",
       "      <td>1.625314</td>\n",
       "      <td>1.728776</td>\n",
       "      <td>1.972289</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 54676 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          1007_s_at   1053_at    117_at    121_at 1255_g_at   1294_at  \\\n",
       "GSM151259  8.598882  6.848821  5.141545  5.877394  2.026605  6.663656   \n",
       "GSM151260  8.523999  6.733007  6.000812  5.956416  1.880405  6.551523   \n",
       "GSM151261  9.151616  7.283071  4.847115  6.031219  1.711745  5.901029   \n",
       "GSM151262  8.619172  6.460641  5.887788  6.124468  1.686634  6.351176   \n",
       "GSM151263   8.92592  6.213657  5.716745  6.323811  1.828178  6.276506   \n",
       "\n",
       "            1316_at   1320_at 1405_i_at   1431_at  ... AFFX-r2-Ec-bioD-5_at  \\\n",
       "GSM151259  3.334369  3.292818  6.333143  2.777916  ...            10.218104   \n",
       "GSM151260  3.330929  3.010386  5.685335   2.83521  ...             9.976598   \n",
       "GSM151261  3.218729  2.588752  7.524602  2.330878  ...            10.454041   \n",
       "GSM151262  3.397831  3.148233  5.594144  2.884427  ...            10.175746   \n",
       "GSM151263  3.612326  3.204559  4.509043  2.546576  ...            10.712507   \n",
       "\n",
       "          AFFX-r2-P1-cre-3_at AFFX-r2-P1-cre-5_at AFFX-ThrX-3_at  \\\n",
       "GSM151259           12.182117           12.002252       2.390509   \n",
       "GSM151260           12.083715           11.794364       2.349284   \n",
       "GSM151261           12.334606           12.034793       2.264607   \n",
       "GSM151262           12.317215           11.963655       2.080147   \n",
       "GSM151263           12.522815           12.370773       2.269168   \n",
       "\n",
       "          AFFX-ThrX-5_at AFFX-ThrX-M_at AFFX-TrpnX-3_at AFFX-TrpnX-5_at  \\\n",
       "GSM151259       2.225881       1.868638        1.629952        1.948431   \n",
       "GSM151260       2.214763       1.764588        1.721504        1.858394   \n",
       "GSM151261       2.138744       1.617288        1.751432        1.831504   \n",
       "GSM151262       2.276124       1.875681        1.712929        1.925453   \n",
       "GSM151263       2.166079       1.842607        1.625314        1.728776   \n",
       "\n",
       "          AFFX-TrpnX-M_at cancer  \n",
       "GSM151259        1.791261      0  \n",
       "GSM151260        2.053418      0  \n",
       "GSM151261        2.025358      0  \n",
       "GSM151262        1.719681      0  \n",
       "GSM151263        1.972289      0  \n",
       "\n",
       "[5 rows x 54676 columns]"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "id": "0415d73d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "Index: 87 entries, GSM151259 to GSM151345\n",
      "Data columns (total 10 columns):\n",
      " #   Column     Non-Null Count  Dtype \n",
      "---  ------     --------------  ----- \n",
      " 0   1007_s_at  87 non-null     object\n",
      " 1   1053_at    87 non-null     object\n",
      " 2   117_at     87 non-null     object\n",
      " 3   121_at     87 non-null     object\n",
      " 4   1255_g_at  87 non-null     object\n",
      " 5   1294_at    87 non-null     object\n",
      " 6   1316_at    87 non-null     object\n",
      " 7   1320_at    87 non-null     object\n",
      " 8   1405_i_at  87 non-null     object\n",
      " 9   1431_at    87 non-null     object\n",
      "dtypes: object(10)\n",
      "memory usage: 7.5+ KB\n"
     ]
    }
   ],
   "source": [
    "df.iloc[:,0:10].info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c9331a70",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "80f1e39b",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b34c3f77",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
